import QtQuick
import QtQuick.Controls

Rectangle {
    width: 400
    height: 300
    color: "lightgray"

    MenuBar {
        width: parent.width
        
        Menu {
            title: "编辑"
            Action {
                id: copyAction
                text: "复制 (Ctrl+C)"
                icon.source: "icons/copy.png"
                shortcut: StandardKey.Copy
                onTriggered: console.log("复制")
            }
            Action {
                id: cutAction
                text: "剪切 (Ctrl+X)"
                icon.source: "icons/cut.png"
                shortcut: StandardKey.Cut
                onTriggered: console.log("剪切")
            }
        }
    }

    Text {
        anchors.centerIn: parent
        text: "使用快捷键 Ctrl+C 和 Ctrl+X\n触发菜单功能"
        horizontalAlignment: Text.AlignHCenter
    }
}
